""" 
    twExtJS - ToscaWidgets wrapper for ExtJS (see http://extjs.com)
    
    Distributed under the terms of Lesser GNU Public License.
    
    (c) 2007 - Ricardo Girardi Sixel 
"""
from toscawidgets.api import CSSLink, JSLink
from toscawidgets.widgets.extJS.core import *
from toscawidgets.widgets.extJS.plugin import PanelRowExpander_js,\
    NestedGridRowExpander_js

desktop_css = CSSLink(
    modname=__name__, filename='static/desktop/css/desktop.css')
desktop_app_base_js = JSLink(
    modname=__name__, filename='static/desktop/js/App.js')
desktop_app_taskbar_js = JSLink(
    modname=__name__, filename='static/desktop/js/TaskBar.js')
desktop_app_startmenu_js = JSLink(
    modname=__name__, filename='static/desktop/js/StartMenu.js')
desktop_app_taskbar_js = JSLink(
    modname=__name__, filename='static/desktop/js/TaskBar.js')
desktop_app_module_js = JSLink(
    modname=__name__, filename='static/desktop/js/Module.js')
desktop_app_desktop_js = JSLink(
    modname=__name__, filename='static/desktop/js/desktop.js')

class Application(Component):
    template = "mako:toscawidgets.widgets.extJS.templates.application.application"
    javascript = [ext_base_js,ext_core_js,ext_all_js,desktop_app_desktop_js,
                  desktop_app_base_js,desktop_app_taskbar_js,desktop_app_startmenu_js,
                  desktop_app_taskbar_js,desktop_app_module_js,
                  PanelRowExpander_js,NestedGridRowExpander_js,
                  ext_lang_pt_BR_js]
    css=[ext_all_css,desktop_css,x_theme_default_css]
    params=Component.params | frozenset(['title','modules'])
    title = 'Title'
    modules=[]
    
class Launcher(Component):
    template = "mako:toscawidgets.widgets.extJS.templates.application.launcher"
    text = ''
    params=Component.params | frozenset(['text','iconCls'])
    iconCls = 'icon-grid'    
    
class Module(Component):    
    template = "mako:toscawidgets.widgets.extJS.templates.application.module"
    laucher = None
    window = None
    name = 'module'
    declarations = {}
    params = Component.params | frozenset(['launcher','window' ,'name','declarations'])